package cn.stylefeng.guns.core.common.cons;

public enum GeneralTypeEnum {

    IS_DELETE(1,"数据不存在"),
    NO_DELETE(0,"数据存在"),

    IS_ORDER(1,"已经被预约"),
    NO_ORDER(0,"没有别预约"),

    IS_RETURN(1,"已经还车"),
    NO_RETURN(0,"未还车"),


    DEFAULT_TIMES(0,"默认租车次数"),
    RENT_TIMES(1,"租车次数加1"),

    IS_RENT(1,"已经被租赁"),
    NO_RENT(0,"没有被租赁"),


    DEFAULT_TIMEOUT(0,"默认没有超过时间"),
    IS_TIMEOUT(1,"过期");


    Integer code;//状态编号
    String name;//状态名称

    //构造方法
    GeneralTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(Integer code){
        for(GeneralTypeEnum Enum : GeneralTypeEnum.values()){
            if(Enum.getCode().equals(code)){
                return Enum.getName();
            }
        }
        return null;
    }

    //成员方法
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
